import { CoolController, BaseController, CoolUrlTag, TagTypes } from '@cool-midway/core';
import { Body, Inject, Post, Get, Query } from '@midwayjs/core';
import { GameLevelInfoEntity } from '../../entity/info'; 
import { GameLevelInfoService } from '../../service/info'; 

/**
 * game模块-关卡信息
 */
@CoolUrlTag({
  key: TagTypes.IGNORE_TOKEN,
  value: ['getLevels','list','page'],
})
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: GameLevelInfoEntity,
  service: GameLevelInfoService,
  pageQueryOp: {
    keyWordLikeFields: ['name'],
    fieldEq: ['type', 'difficulty', 'status','levelNumber'],
  }
})
export class AppGameLevelInfoController extends BaseController {
    @Inject()
    gameLevelInfoService: GameLevelInfoService;

    @Get('/getLevels', { summary: '获取关卡详情' })
    async getLevels() {
        return this.ok(await this.gameLevelInfoService.getLevels());
    }
}
